package org.zjt.auth.config;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@EnableAspectJAutoProxy
@Aspect
public class AspectConfig {

	@Before("execution(* org.zjt.auth.controller..*.*(..))")
	public void before(){
		System.out.println("---------before------------");
	}
	
	@After("execution(* org.zjt.auth.controller..*.*(..))")
	public void after(){
		System.out.println("---------after------------");
	}
	
//	@Around("execution(* org.zjt.auth.controller..*.*(..))")
//	public void around(ProceedingJoinPoint joinpoint){
//		System.out.println("---------around------------"+joinpoint);
//	}
	
	@AfterThrowing(throwing="ex",pointcut="execution(* org.zjt.auth.controller..*.*(..))")
	public void AfterExcepter(Throwable ex){
		System.out.println("---------AfterExcepter------------"+ex);
	}
}
